/**
 * 
 */
package neptune.manager.storage;

import java.util.Arrays;

import neptune.manager.User;
import neptune.manager.model.experiment.Experiment;

/**
 * @author Roberto Bifulco [RobertoBifulco.it] [info@robertoBifulco.it]
 *
 */
public class XMLExperimentsRepositoryTEST {

	public static void main(String[] args) throws ExperimentRepositoryException {
		XMLExperimentsRepository repo = new XMLExperimentsRepository("experiments");
		
		System.out.println(Arrays.toString(repo.getExperiments()));
		
		Experiment exp = new Experiment("roberto","exp1");
		exp.addUser(new User("user1"));
		exp.addUser(new User("user2"));
		repo.writeExperimentFile(exp);
		
		Experiment exp2 = repo.readExperimentFile(exp.getExperimentId());
		exp2.setExperimentId("exp2");
		repo.writeExperimentFile(exp2);
		
		repo.deleteExperimentUser("exp2", "user1");
	}
}
